# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItemView do
  @moduledoc """
  A container for a single DataItem and Annotations on it.

  ## Attributes

  *   `annotations` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Annotation.t)`, *default:* `nil`) - The Annotations on the DataItem. If too many Annotations should be returned for the DataItem, this field will be truncated per annotations_limit in request. If it was, then the has_truncated_annotations will be set to true.
  *   `dataItem` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItem.t`, *default:* `nil`) - The DataItem.
  *   `hasTruncatedAnnotations` (*type:* `boolean()`, *default:* `nil`) - True if and only if the Annotations field has been truncated. It happens if more Annotations for this DataItem met the request's annotation_filter than are allowed to be returned by annotations_limit. Note that if Annotations field is not being returned due to field mask, then this field will not be set to true no matter how many Annotations are there.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotations =>
            list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Annotation.t()) | nil,
          :dataItem => GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItem.t() | nil,
          :hasTruncatedAnnotations => boolean() | nil
        }

  field(:annotations,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Annotation,
    type: :list
  )

  field(:dataItem, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItem)
  field(:hasTruncatedAnnotations)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItemView do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItemView.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1DataItemView do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
